package xyz.jcat.common.util;

import xyz.jcat.common.exception.SystemException;

import java.io.Closeable;
import java.io.IOException;

public class IOUtils {

    public static void close(Closeable... targets) {
        if (ArrayUtils.isEmpty(targets)) {
            return;
        }
        for (Closeable target : targets) {
            if (target != null) {
                try {
                    target.close();
                } catch (IOException e) {
                    throw new SystemException("关闭连接异常", e);
                }
            }
        }
    }

}
